package com.laborder.sysyy.service.teacher.impl;

import com.laborder.sysyy.dao.TeacherDaoMapper;
import com.laborder.sysyy.entity.Teacher;
import com.laborder.sysyy.service.teacher.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author 786107529@qq.com FJL
 * @Date 2018/9/10 11:53
 */
@Service
@Transactional
public class TeacherServiceImpl implements TeacherService {
    @Autowired
    private TeacherDaoMapper teacherDaoMapper;

    public List<Teacher> findTeacherWithPage(Map<String,Object> map){
        return teacherDaoMapper.findTeacherWithPage(map);
    }
    @Override
    public int getTeacherCount(Map<String,Object>map) {

        return teacherDaoMapper.getTeacherCount(map);
    }
    @Override
    public  int saveTeacherInfo(Teacher teacher) {

        return teacherDaoMapper.saveTeacherInfo(teacher);
    }
    @Override
    public  boolean updateTeacherInfo(Teacher teacher) {
        if(teacherDaoMapper.updateTeacherInfo(teacher)!=0){
            return true;
        }else{
            return false;
        }
    }   
    
     /**
       * @function:  删除教师信息
       * @author: 759057893@qq.com lyz
       * @date: 2019/1/10 14:21
       */
    @Override
    public boolean delTeacherInfo(int tId) {
        if(teacherDaoMapper.delTeacherInfo(tId)!=0)
            return true;
        return false;
    }
     /**
       * @function: 批量删除教师信息
       * @author: 759057893@qq.com lyz
       * @date: 2019/1/10 14:22
       */
    @Override
    public boolean delManyTeacherInfo(int tId) {
        if(teacherDaoMapper.delManyTeacherInfo(tId)!=0)
            return true;
        return false;
    }


    @Override
    public Teacher getTeacherInfo(int tId) {

        return teacherDaoMapper.getTeacherInfo(tId);
    }

    @Override
    public Teacher getTeacherInfoByName(String tName, String tPhone) {
        return teacherDaoMapper.getTeacherInfoByName(tName,tPhone);
    }

    @Override
    public List<Teacher> getAllTeacher() {

        return teacherDaoMapper.getAllTeacher();
    }

    @Override
    public Teacher selectTeacherById(int tId) {
        return teacherDaoMapper.selectTeacherById(tId);
    }


}
